package com.acme.bankapp.domain.bank;

public class SavingsAccount extends AbstractAccount{
	
	public SavingsAccount(double  amount) {
		if ( amount < 0 ){
			System.out.println("Error creating account! (amount has negative value)");
		} else {
			this.balance =  amount;
		}
	}

	public void withdraw(double amount){
		if (this.balance >= amount){
			this.balance -= amount;
		}
	}

	public double getBalance() {
		return balance;
	}
	public void setBalance(double balance) {
		this.balance = balance;
	}
	@Override
	public double maximumAmountToWithdraw() {
		return this.balance;
	}

}
